package cn.zqy.demo.day09;

public class Zi extends Fu {
    int numZi = 99;
    int num = 40;

    public void methodZi() {
        System.out.println("子类方法执行");
        System.out.println(num);
    }

    public void methodZz() {
        System.out.println( "super的numFu: " +super.numFu);
        System.out.println("直接numFu: " + numFu);
    }

    public void method() {
        int num = 60;
        System.out.println("局部变量：" + num);  // 60
        System.out.println("子类成员变量：" + this.num);   // 40
        System.out.println("父类成员变量：" + super.num);  // 20
    }

    public void sameMethod() {
        System.out.println("子类相同方法执行！！！");
    }

    //  Demo05中@Override方法，返回值范围缩小，权限扩大
    @Override
    public String overMethod() {
        return null;
    }
}
